<template>
    <div id="home">
        <div id="head">
            <img style="height: 56px; width: 144px;" src='../assets/美食地图logo.jpg'  @click="gohome()"/>
            <div id="headr">
                <el-button type="warning" @click="gorecommend()">找你想吃</el-button>
                <img style="height: 48px; width: 48px;" src='../assets/美食地图logo.jpg' />
                <p>{用户名}</p>
                <el-button icon="ArrowLeftBold" circle @click="out()" />
            </div>
        </div>

        <div id="body">

            <div id="bodyb">
                <el-backtop right="100px" bottom="100px" visibility-height="400px" target="#bodyb" />

                <h2>{餐厅名} <span>{4.5}</span> </h2>
                <el-carousel trigger="click" height="150px">
                    <el-carousel-item v-for="item in 4" :key="item">
                        <h3 class="small justify-center" text="2xl">{{ item }}</h3>
                    </el-carousel-item>
                </el-carousel>

                <p>{餐厅的位置}</p>

                <h3>餐厅特色菜</h3>

                <div id="foods">
                    <div id="ffor" v-for="food in 6">
                        <img src="" />
                        <p>{名称}</p>
                        <p>味道:{酸甜苦辣咸}</p>
                        <p>简介:{西瓜西红柿，鸡蛋鹅蛋鸭蛋}</p>
                    </div>
                </div>

                <div id="comment">

                    <div id="userc">
                        <el-input v-model="textarea" style="width: 100%;" rows=5 type="textarea" placeholder="写写你的评价" />
                        <el-rate v-model="value1" />
                        <el-button type="success" @click=""
                            style="width: 128px;height: 48px;float: right;margin: 10px 0;">发表</el-button>
                    </div>

                    <h3>评论</h3>
                    <div id="comments">
                        <div id="cfor" v-for="comment in 24">
                            <div>
                                <img src="" />
                                <p>{用户名}</p>
                            </div>
                            <p>{评语}</p>
                            <p>{4.5}</p>
                        </div>
                    </div>
                </div>
            </div>
            <div id="foot">
                <p>这是页面底部</p>
                <p>遵纪守法好公民，代码开源好码农</p>
            </div>
        </div>

    </div>

</template>

<script setup>
import axios from 'axios'
import {
    Search,
    CloseBold
} from '@element-plus/icons-vue';
import {
    ref,
    reactive,
    onMounted
} from 'vue';
import {
    useRouter,
    useRoute
} from 'vue-router'

const router = useRouter()
const rout = useRoute()
const shopId = ref(rout.query.shopid)
const shopDetail =ref()

onMounted(()=>{

    axios.get(
            `http://localhost:8081/Shop/getDetail/${shopId.value}`
        ).then(res=>{
		shopDetail.value = res.data.data
		})
     console.log(shopDetail)
})

function out() {
    router.push({
        name: 'Login'
    })
}

function gohome() {
		router.push({
			name: 'Home'
		})
	}

	function gorecommend() {
		router.push({
			name: 'Recommend'
		})
	}
</script>

<style scoped>
#home {
    height: 100vh;
    width: 100vw;
    background: url('../assets/美食地图.jpg') no-repeat;
    background-size: cover;
    justify-content: center;
    align-items: center;

    #head {
        position: fixed;
        top: 0;
        height: 64px;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.9);
        justify-content: space-between;
        display: flex;
        box-shadow: 0px 2px 2px gray;
        z-index: 1000;

        img {
            padding: 4px;
            border-radius: 10px;
            cursor: pointer;
        }

        #headr {
            height: 100%;
            width: 360px;
            display: flex;
            align-items: center;

            * {
                display: inline-block;
            }

            img {
                border-radius: 50%;
                padding: 0 16px;
            }

            p {
                width: 128px;
                overflow: hidden;
                padding: 0 16px;
            }
        }
    }

    #body {
        width: 100%;
        height: 100%;
        overflow: auto;

        #bodyb {
            width: 1120px;
            padding: 0 40px 40px;
            background-color: rgba(255, 255, 255, 0.25);

            h2 {
                width: 1120px;
                line-height: 80px;
                font-size: 64px;
                font-weight: 900;
                font-family: cursive;
                margin-top: 100px;

                span {
                    font-family: fantasy;
                    font-size: 32px;
                    font-weight: 600;
                    color: orangered;
                }
            }

            h3 {
                width: 1120px;
                line-height: 64px;
                font-size: 48px;
                font-weight: 900;
                font-family: cursive;
                margin-top: 80px;
                border-bottom: solid 8px lightblue;

            }

            .el-carousel {
                width: 1120px;
                height: 400px;
                margin-top: 80px;

            }

            p {
                width: 1120px;
                text-align: right;
                margin-top: 80px;
                line-height: 32px;
                font-size: 24px;
                font-weight: 600;
            }

            #foods {
                width: 1120px;
                overflow: auto;
                display: grid;
                grid-template-columns: 1fr 1fr 1fr;
                grid-gap: 20px 20px;
                margin-bottom: 40px;
                margin-top: 40px;


                #ffor {
                    width: 100%;
                    border-radius: 10px;
                    background-color: white;
                    overflow: hidden;

                    img {
                        width: 100%;
                        height: 200px;
                    }

                    p {
                        width: auto;
                        margin: 0;
                        padding: 8px;
                        text-align: left;

                    }

                    p:nth-of-type(1) {
                        font-size: 24px;
                    }

                    p:nth-of-type(2) {
                        font-size: 22px;
                        font-weight: normal;
                    }

                    p:nth-of-type(3) {
                        font-size: 18px;
                        font-weight: normal;
                    }
                }
            }

            #comment {
                background-color: white;
                border-radius: 10px;

                #userc {
                    padding: 20px;
                }

                h3 {
                    width: 1120px;
                    line-height: 64px;
                    font-size: 48px;
                    font-weight: 900;
                    font-family: cursive;
                    margin: 64px 0 0;
                    border-bottom: solid 1px gray;
                }

                #comments {
                    width: 1120px;

                    #cfor {
                        display: grid;
                        grid-template-columns: 1fr 6fr 1fr;

                        * {
                            width: auto;
                            margin: 0;
                            text-align: left;

                        }

                        div {

                            img {
                                width: 80px;
                                height: 80px;
                            }

                            p {
                                width: auto;
                                font-size: 18px;
                                font-weight: 300;
                                line-height: 20px;
                                padding: 0px 0px 20px 0px !important;
                            }
                        }

                        p:nth-of-type(1) {
                            width: auto;
                            font-size: 18px;
                            font-weight: 300;
                            line-height: 20px;
                            padding: 20px;
                        }

                        p:nth-of-type(2) {
                            font-size: 48px;
                            line-height: 80px;
                            text-align: center;
                            color: black;
                        }

                    }

                }
            }
        }

        * {
            margin: 0 auto;
        }

    }

    #foot {
        width: 100%;
        height: 160px;
        background-color: lightblue;
        box-shadow: 0px -2px 2px lightblue;

        p {
            text-align: center;
        }

        p:nth-of-type(1) {
            line-height: 128px;
            font-size: 32px;
        }

        p:nth-of-type(2) {
            line-height: 32px;
            font-size: 16px;
            font-family: cursive;
            background-color: white;
        }
    }
}
</style>